﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Configuration;


namespace MaintenanceService.Common.Dal
{

    public static class DalFactory
    {
        public static DalObject GetDalObject()
        {
            using (IUnityContainer container = new UnityContainer())
            {
                UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
                section.Containers.Default.Configure(container);
                DalObject service = container.Resolve<DalObject>();
                return service;
            }
        }
    }
}
